finished and refactored crud for beds"