Well sort of. You don't need to have built the actual thing to get a patent.
You cannot patent the completely generic idea of "a tool to lift people in buildings", but you can patent an elevator.
Similarly, you cannot patent "the ability to scan a database", but you can patent an api for doing so, even without a complete implementation of that api.
Patenting an API makes sense, since APIs are essentially ideas. Copyrighting an API does not make sense.